abstract class Vehicle{
    private int wheels;
    private double weight;
    public Vehicle(int wheels, double weight) {
        this.wheels = wheels;
        this.weight = weight;
    }
    public void run(){
        System.out.println("车子在用"+wheels+"个轮子跑"+",车子重"+weight+"吨");
    }
    public abstract void zhunzai();
}
 class Car extends Vehicle{
      int loader;
      public Car(int wheels, double weight, int loader) {
         super(wheels, weight);
         this.loader = loader;
     }
     public Car(int wheels, double weight) {
         super(wheels, weight);
     }
     @Override
      public void zhunzai() {
          System.out.println("此车准载"+loader+"人");
      }
      public void huowu(){
          System.out.println("此车为小轿车不能载货");
      }
 }
  class Truck extends Car{
    double payload;
      public Truck(int wheels, double weight, int loader, double payload) {
          super(wheels, weight, loader);
          this.payload = payload;
      }
      @Override
      public void zhunzai() {
          System.out.println("此车准载"+loader+"人");
      }
      @Override
      public void huowu() {
          System.out.println("此车为大卡车载货"+payload+"吨");
      }
  }
  public class Test {
    public static void main(String[] args) {
        Vehicle vehicle = new Car(4,4.5,5);
        vehicle.run();
       vehicle.zhunzai();
       Car car = new Car(00,0,0);
       car = (Car)vehicle;
       car.huowu();
        System.out.println("===========================");
        Vehicle vehicle1 = new Truck(8,38,7,8);
        vehicle1.run();
        vehicle1.zhunzai();
        Truck truck = new Truck(0,0,0,0);
        truck = (Truck)vehicle1;
        truck.huowu();
    }
}
